package sos.entrega2013.mr1.noviembre;

import java.io.IOException;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.TextInputFormat;
import org.apache.hadoop.mapred.TextOutputFormat;

import sos.entrega2013.mr1.noviembre.bo.toptres.*;
import sos.entrega2013.mr1.noviembre.beans.*;

public class TopTres {

	public static void main(String[] args) {
		try {
			JobConf conf = new JobConf(FraudDetection.class);
			conf.setJobName("Red Social de Usuarios");
			//define las salidas del map y del reduce
			conf.setOutputKeyClass(Text.class);
			conf.setOutputValueClass(CDR.class);
	
			conf.setMapperClass(TopTresMap.class);
			//conf.setCombinerClass(FacturacionReduce.class);
			conf.setReducerClass(TopTresReduce.class);
	
			conf.setInputFormat(TextInputFormat.class);
			conf.setOutputFormat(TextOutputFormat.class);
			FileInputFormat.setInputPaths(conf, new Path(args[0]));
			FileOutputFormat.setOutputPath(conf, new Path(args[1]));			
			JobClient.runJob(conf);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
